package com.ljdemo.wecompose

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.pager.HorizontalPager
import androidx.lifecycle.viewmodel.compose.viewModel
import com.ljdemo.wecompose.ui.WeBottomBar
import com.ljdemo.wecompose.ui.theme.WeComposeTheme

class MainActivity : ComponentActivity() {

    @OptIn(ExperimentalFoundationApi::class)
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            WeComposeTheme {
                // A surface container using the 'background' color from the theme
                Column {
                    val viewModel:WeViewModel= viewModel()

//                    HorizontalPager(pageCount = 4) { page ->
//                        when (page) {
//                            0 -> {
//
//                            }
//                            1 -> {
//
//                            }
//                            2 -> {
//
//                            }
//                            3 -> {
//
//                            }
//                        }
//                    }
                    WeBottomBar(viewModel.selectedTab){
                        viewModel.selectedTab=it
                    }
                }
            }
        }
    }
}
